<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // Number()
        var a=Number(prompt("请输入第一个数："))
        var b=prompt("请输入运算符：")//+ - * /
        var c=Number(prompt("请输入第二个数："))
        var d;

        switch(b){
            case "+":
            // console.log("a+c="+(a+c));
            console.log(d=a+c)
            break;
            case "-":
            console.log(d=a-c)
            // console.log("a-c="+(a-c));
            break;
            case "*":
            console.log(d=a*c)
            // console.log("a*c="+a*c);
            break;
            case "/":
            console.log("a/c="+a/c);
            break;
            default:
            console.log("输入有误，请重新输入");
            break;
        }

    </script>
</body>
</html>